(verify_interval_modification): Don't just test
authorRichard M. Stallman <rms@gnu.org>
Sun, 20 Jun 1993 08:48:58 +0000 (08:48 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sun, 20 Jun 1993 08:48:58 +0000 (08:48 +0000)
Qread_only prop; use INTERVAL_WRITABLE_P.

src/intervals.c

index a737e9dceefc57d3e1eb5eabd0b59b44711cbfc0..3d30e21c3ee43a7cffe6f84991a70184ae83e542 100644 (file)
@@ -1479,21 +1479,22 @@ verify_interval_modification (buf, start, end)
 
       if (NULL_INTERVAL_P (prev))
        {
-         after = textget (i->plist, Qread_only);
-         if (! NILP (after))
+         if (! INTERVAL_WRITABLE_P (i))
            error ("Attempt to insert within read-only text");
        }
       else if (NULL_INTERVAL_P (i))
        {
-         before = textget (prev->plist, Qread_only);
-         if (! NILP (before))
+         if (! INTERVAL_WRITABLE_P (prev))
            error ("Attempt to insert within read-only text");
        }
       else
        {
          before = textget (prev->plist, Qread_only);
          after = textget (i->plist, Qread_only);
-         if (! NILP (before) && EQ (before, after))
+         if (! NILP (before) && EQ (before, after)
+             /* This checks Vinhibit_read_only properly
+                for the common value of the read-only property.  */
+             && ! INTERVAL_WRITABLE_P (i))
            error ("Attempt to insert within read-only text");
        }